﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SY.BasicData.Api.Read.Applications.DeepProcessing.Command;
using SY.BasicData.Domain.DeepProcessing;
using SY.BasicData.ErrorCode;
using SY.BasicData.Infrastructures;

namespace SY.BasicData.Api.Read.Controllers.DeepProcessing
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    //深加工
    public class DeepProcessingController : ControllerBase
    {
        private readonly IMediator mediator;
        private readonly ILogger<DeepProcessingController> logger;

        public DeepProcessingController(IMediator mediator, ILogger<DeepProcessingController> logger)
        {
            this.mediator = mediator;
            this.logger = logger;
        }
        /// <summary>
        /// 深加工信息明细表
        /// </summary>
        /// <param name="command">明细</param>
        /// <returns>返回结果</returns>
        /// 
        [HttpGet]
        public Task<ApiResult<DeepProcessingModel>> DeepProcessingDetail([FromQuery] DeepProcessingCommand command)
        {
           return mediator.Send(command);
        }
        /// <summary>
        /// 深加工企业信息明细表
        /// </summary>
        /// <param name="command">明细</param>
        /// <returns>返回结果</returns>
        /// 
        [HttpGet]
        public Task<ApiResult<DeepVendorModel>> DeepProcessingCompanyDetail([FromQuery] DeepProcessingCompanyCommand command)
        {

            return mediator.Send(command);
        }
    }
}
